package Chapter05;

public class Test5_1 {

	public static int reverseInt(int input) {
		int reversedNum = 0;
		while (input != 0) {
			reversedNum = reversedNum * 10 + input % 10;
			input = input / 10;
		}
		return reversedNum;
	}

	public static void main(String[] args) {
		int input = 352;
		int reversed = reverseInt(input);
		System.out.println("Reversed=" + String.valueOf(reversed));
	}

}